package com.chenjiajin.controller;

import com.chenjiajin.domain.PojoDemo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DemoController {


    // http://localhost/aop?test=1
    @RequestMapping("/aop")
    public PojoDemo<String> aop(String test) {
        System.out.println("这是执行方法");
        //int a = 1 / 0;
        return new PojoDemo<>("success");
    }


    // http://localhost/aop2
    @RequestMapping("/aop2")
    public PojoDemo<PojoDemo<Integer>> aop2() {
        System.out.println("这是执行方法2");
        return new PojoDemo<>(new PojoDemo<>(2));
    }


}